#!/bin/sh

## Install all required packages
sudo aptitude install cmake cmake-curses-gui cmake-data cmake-gui \
   python python-dev python-cxx python-cxx-dev \
   octave octave-headers octave-pkg-dev \
   liblapack-dev liblapack-test libblas-dev libblas-test \
   subversion \
   libgomp1 \
   swig swig-doc swig-examples \
   pkg-config \
   libjpeg-dev \
   libtiff-dev libtiff-doc libtiff-opengl libtiff-tools \
   libjasper-dev libjasper-runtime libjasper1 \
   libpng-dev \
   zlibc zlib-bin \
   libavformat-dev libswscale-dev \
   libgstreamer0.10-0 libgstreamer0.10-dev \
   libxine-dev libxine-doc libxine-xvdr libxine1 \
   libunicap-dev libucil-dev \
   libdc1394-22 libdc1394-22-dev libdc1394-utils \
   libgtk2.0-dev libgtk2.0-bin \
&& \
mkdir release && \
cd release && \
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON .. && \
make && make install

## Libtool installtion seems to have some issues with linkers
## hence changed to cmake
#export SETTINGS="CC=gcc CXX=g++ PYTHON=/usr/bin/python
#--build=`uname -m` 
#--enable-openmp
#--enable-optimization
#--with-native-lapack
#--enable-apps
#--with-swig
#--without-python
#--without-octave
#--without-quicktime
#--with-xine
#--with-ffmpeg
#--with-unicap
#--with-gtk
#--with-gthread" \
#&& \
#./configure $SETTINGS && make && make install 

